package severlet;

import bean.Express;
import dao.ExpressDao;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "AdminDelExpressServlet", value = "/AdminDelExpressServlet")
public class AdminDelExpressServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    request.setCharacterEncoding("utf-8");
        String dormitoryid = request.getParameter("dormitoryid");
        String studentname = request.getParameter("studentname");
//删除
        ExpressDao expressDao=new ExpressDao();
        expressDao.delInfo(studentname,dormitoryid);

        request.getRequestDispatcher("/AdminExpressServlet").forward(request,response);
    }
}
